@import '../../style/variable.scss';

.xxm-popup-ls{

    position: fixed;
  box-sizing: border-box;
  max-height: 100%;
  overflow-y: auto;
  transition-timing-function: ease;
  animation: ease both;
  -webkit-overflow-scrolling: touch;
  background-color: $popup-background-color;

  &--center {
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);

    &.xxm-popup-ls--round {
      border-radius: $popup-round-border-radius;
    }
  }

  &--top {
    top: 0;
    left: 0;
    width: 100%;

    &.xxm-popup-ls--round {
      border-radius: 0 0 $popup-round-border-radius $popup-round-border-radius;
    }
  }

  &--right {
    top: 50%;
    right: 0;
    transform: translate3d(0, -50%, 0);

    &.xxm-popup-ls--round {
      border-radius: $popup-round-border-radius 0 0 $popup-round-border-radius;
    }
  }

  &--bottom {
    bottom: 0;
    left: 0;
    width: 100%;

    &.xxm-popup-ls--round {
      border-radius: $popup-round-border-radius $popup-round-border-radius 0 0;
    }
  }

  &--left {
    top: 50%;
    left: 0;
    transform: translate3d(0, -50%, 0);

    &.xxm-popup-ls--round {
      border-radius: 0 $popup-round-border-radius $popup-round-border-radius 0;
    }
  }

  &--bottom {
    &.xxm-popup-ls--safe{
      padding-bottom: constant(safe-area-inset-bottom);
      padding-bottom: env(safe-area-inset-bottom);
    }
   
  }

  &--safeTop {
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
  }

  &__close-icon {
    position: absolute;
    z-index: $popup-close-icon-z-index;
    color: $popup-close-icon-color;
    font-size: $popup-close-icon-size;

    &--top-left {
      top: $popup-close-icon-margin;
      left: $popup-close-icon-margin;
    }

    &--top-right {
      top: $popup-close-icon-margin;
      right: $popup-close-icon-margin;
    }

    &--bottom-left {
      bottom: $popup-close-icon-margin;
      left: $popup-close-icon-margin;
    }

    &--bottom-right {
      right: $popup-close-icon-margin;
      bottom: $popup-close-icon-margin;
    }

    &:active {
      opacity: 0.6;
    }
  }
}



.xxm-scale-enter-active,
.xxm-scale-leave-active {
  transition-property: opacity, transform;
}

.xxm-scale-enter,
.xxm-scale-leave-to {
  transform: translate3d(-50%, -50%, 0) scale(0.7);
  opacity: 0;
}

.xxm-fade-enter-active,
.xxm-fade-leave-active {
  transition-property: opacity;
}

.xxm-fade-enter,
.xxm-fade-leave-to {
  opacity: 0;
}

.xxm-center-enter-active,
.xxm-center-leave-active {
  transition-property: opacity;
}

.xxm-center-enter,
.xxm-center-leave-to {
  opacity: 0;
}

.xxm-bottom-enter-active,
.xxm-bottom-leave-active,
.xxm-top-enter-active,
.xxm-top-leave-active,
.xxm-left-enter-active,
.xxm-left-leave-active,
.xxm-right-enter-active,
.xxm-right-leave-active {
  transition-property: transform;
}

.xxm-bottom-enter,
.xxm-bottom-leave-to {
  transform: translate3d(0, 100%, 0);
}

.xxm-top-enter,
.xxm-top-leave-to {
  transform: translate3d(0, -100%, 0);
}

.xxm-left-enter,
.xxm-left-leave-to {
  transform: translate3d(-100%, -50%, 0);
}

.xxm-right-enter,
.xxm-right-leave-to {
  transform: translate3d(100%, -50%, 0);
}
